package city.spring.repository.mealService;

import city.spring.domain.entity.mealService.FoodInfoEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.time.LocalDate;
import java.time.LocalTime;
import java.util.List;

@Repository
public interface FoodInfoRepository extends BaseMapper<FoodInfoEntity> {

    /**
     * 获取食谱的食品
     *
     * @param recipesId 食谱ID
     * @return 食品列表
     */
    List<FoodInfoEntity> getRecipesFood(@Param("recipesId") String recipesId);

    List<FoodInfoEntity> getNormalDiseaseFood(@Param("idList") List<String> diseaseId);

    List<FoodInfoEntity> getMealTurnFood(@Param("mealWeekId") String mealWeekId, @Param("mealTurn") String mealTurn);

    List<FoodInfoEntity> getDiseaseFoodAll(@Param("idList") List<String> diseaseId, @Param("forbiddenOrRecommend") int forbiddenOrRecommend);

    List<FoodInfoEntity> getCurrentDiseaseFoodAll(@Param("idList") List<String> diseaseId, @Param("startTime") LocalTime startTime, @Param("endTime") LocalTime endTime, @Param("date") LocalDate date, @Param("forbiddenOrRecommend") int forbiddenOrRecommend);

    List<FoodInfoEntity> getCurrentNormalFoodAll(@Param("idList") List<String> diseaseId, @Param("startTime") LocalTime startTime, @Param("endTime") LocalTime endTime, @Param("date") LocalDate date);

    List<FoodInfoEntity> getCurrentFoodAll(@Param("startTime") LocalTime startTime, @Param("endTime") LocalTime endTime, @Param("date") LocalDate date);

    List<FoodInfoEntity> getWeekFoodAll(@Param("date") LocalDate date);

    List<String> getMealTurnFoodId(@Param("mealWeekId") String mealWeekId, @Param("mealTurn") String mealTurn);

}
